#!/bin/sh 
expr 'aaaaaa' : '(a*)\1\1(a*)\2\2\2' > /dev/null; echo Retval = $?
expr 'aaaa' : '(a*)(a*)\1\2' > /dev/null; echo Retval = $?
expr 'aaaa' : '(a*)\1(a*)\2\2' > /dev/null; echo Retval = $?
expr 'aaaaaa' : '(a*)\1\1(a*)' > /dev/null; echo Retval = $?
expr 'aaaaaa' : '(a*)\1\1(a*)\2' > /dev/null; echo Retval = $?
expr 'aaaaaa' : '(a*)\1\1(a*)\2\2' > /dev/null; echo Retval = $?
expr 'aaaaaa' : '(.*)\1\1(.*)\2\2\2' > /dev/null; echo Retval = $?
expr 'aaaaaaa' : '(.*)\1\1(.*)\2\2\2' > /dev/null; echo Retval = $?
expr 'aaaaaa' : '(.*)\1\1(.*)\2\2\2' > /dev/null; echo Retval = $?
expr 'aaaaaaa' : '(.*)\1\1(.*)\2\2\2' > /dev/null; echo Retval = $?
expr 'aaaaa' : '(.*)\1\1(.*)\2\2\2' > /dev/null; echo Retval = $?
expr 'aaaaaa' : 'a*a*a*a*' > /dev/null; echo Retval = $?
expr 'aaaaaa' : 'a*a*a*a*a*' > /dev/null; echo Retval = $?
expr 'aaaaaa' : 'a*a*a*a*a*a*' > /dev/null; echo Retval = $?
expr 'aaaaaa' : 'a*a*a*a*a*a*a*' > /dev/null; echo Retval = $?
expr '' : '"' > /dev/null; echo Retval = $?
expr 'abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdf' : '(a.*bcde\|a.*cde\|a.*de\|a.*e)(a.*b\|a.*c\|a.*d\|a.*e)\1' > /dev/null; echo Retval = $?
expr '' : '' > /dev/null; echo Retval = $?
expr 'abc' : 'ab{0,0}c' > /dev/null; echo Retval = $?
expr 'abbc' : 'ab{1,1}c' > /dev/null; echo Retval = $?
expr 'abbbbbbbbc' : 'ab{3,7}c' > /dev/null; echo Retval = $?
expr 'abbbbbbbbbc' : 'ab{3,7}c' > /dev/null; echo Retval = $?
expr 'abbbbbbbbbbc' : 'ab{3,7}c' > /dev/null; echo Retval = $?
expr 'abbbbbbbbbbbc' : 'ab{3,7}c' > /dev/null; echo Retval = $?
expr 'bb' : 'b{2,7}' > /dev/null; echo Retval = $?
expr '' : '' > /dev/null; echo Retval = $?
expr 'b' : 'b{1,6}' > /dev/null; echo Retval = $?
expr 'b' : 'b{2,7}' > /dev/null; echo Retval = $?
expr 'ac' : 'ab{0,7}c' > /dev/null; echo Retval = $?
expr 'abc' : 'ab{1,7}c' > /dev/null; echo Retval = $?
expr 'abbc' : 'ab{2,7}c' > /dev/null; echo Retval = $?
expr 'abbbc' : 'ab{3,7}c' > /dev/null; echo Retval = $?
expr 'abbbbc' : 'ab{3,7}c' > /dev/null; echo Retval = $?
expr 'abbbbbc' : 'ab{3,7}c' > /dev/null; echo Retval = $?
expr 'abbbbbbc' : 'ab{3,7}c' > /dev/null; echo Retval = $?
expr 'abbbbbbbc' : 'ab{3,7}c' > /dev/null; echo Retval = $?
expr 'abbbbbbbbc' : 'ab{3,7}c' > /dev/null; echo Retval = $?
expr 'abbc' : 'ab{3,7}c' > /dev/null; echo Retval = $?
expr 'abc' : 'ab{3,7}c' > /dev/null; echo Retval = $?
expr 'foo' : '[]][[.].]][[.right-square-bracket.]]	a]]]' > /dev/null; echo Retval = $?
expr 'aaaaaa' : 'a*a*' > /dev/null; echo Retval = $?
expr 'aaaaaa' : 'a*a*a*' > /dev/null; echo Retval = $?
expr 'aaa' : '(.*)\1\1' > /dev/null; echo Retval = $?
expr 'xc' : '(a\|b)*c\|(a\|ab)*c' > /dev/null; echo Retval = $?
expr 'b' : '(a)*' > /dev/null; echo Retval = $?
expr 'a' : '(..)*(...)*' > /dev/null; echo Retval = $?
expr 'abc' : '(..)*(...)*' > /dev/null; echo Retval = $?
expr 'xx' : '(.*)*\1' > /dev/null; echo Retval = $?
expr '' : '' > /dev/null; echo Retval = $?
expr '' : '' > /dev/null; echo Retval = $?
expr '' : '' > /dev/null; echo Retval = $?
expr 'a' : '^a$' > /dev/null; echo Retval = $?
expr 'abc' : 'abc' > /dev/null; echo Retval = $?
expr 'xbc' : 'abc' > /dev/null; echo Retval = $?
expr 'axc' : 'abc' > /dev/null; echo Retval = $?
expr 'abx' : 'abc' > /dev/null; echo Retval = $?
expr 'xabcy' : 'abc' > /dev/null; echo Retval = $?
expr 'ababc' : 'abc' > /dev/null; echo Retval = $?
expr 'abc' : 'ab*c' > /dev/null; echo Retval = $?
expr 'abc' : 'ab*bc' > /dev/null; echo Retval = $?
expr 'abbc' : 'ab*bc' > /dev/null; echo Retval = $?
expr 'abbbbc' : 'ab*bc' > /dev/null; echo Retval = $?
expr 'abbc' : 'ab+bc' > /dev/null; echo Retval = $?
expr 'abc' : 'ab+bc' > /dev/null; echo Retval = $?
expr 'abq' : 'ab+bc' > /dev/null; echo Retval = $?
expr 'abbbbc' : 'ab+bc' > /dev/null; echo Retval = $?
expr 'abbc' : 'ab?bc' > /dev/null; echo Retval = $?
expr 'abc' : 'ab?bc' > /dev/null; echo Retval = $?
expr 'abbbbc' : 'ab?bc' > /dev/null; echo Retval = $?
expr 'abc' : 'ab?c' > /dev/null; echo Retval = $?
expr 'abc' : '^abc$' > /dev/null; echo Retval = $?
expr 'abcc' : '^abc$' > /dev/null; echo Retval = $?
expr 'abcc' : '^abc' > /dev/null; echo Retval = $?
expr 'aabc' : '^abc$' > /dev/null; echo Retval = $?
expr 'aabc' : 'abc$' > /dev/null; echo Retval = $?
expr 'abc' : '^' > /dev/null; echo Retval = $?
expr 'abc' : '$' > /dev/null; echo Retval = $?
expr 'abc' : 'a.c' > /dev/null; echo Retval = $?
expr 'axc' : 'a.c' > /dev/null; echo Retval = $?
expr 'axyzc' : 'a.*c' > /dev/null; echo Retval = $?
expr 'axyzd' : 'a.*c' > /dev/null; echo Retval = $?
expr 'abc' : 'a[bc]d' > /dev/null; echo Retval = $?
expr 'abd' : 'a[bc]d' > /dev/null; echo Retval = $?
expr 'abd' : 'a[b-d]e' > /dev/null; echo Retval = $?
expr 'ace' : 'a[b-d]e' > /dev/null; echo Retval = $?
expr 'aac' : 'a[b-d]' > /dev/null; echo Retval = $?
expr 'a-' : 'a[-b]' > /dev/null; echo Retval = $?
expr 'a-' : 'a[b-]' > /dev/null; echo Retval = $?
expr '-' : 'a[b-a]' > /dev/null; echo Retval = $?
expr '-' : 'a[]b' > /dev/null; echo Retval = $?
expr '-' : 'a[' > /dev/null; echo Retval = $?
expr 'a]' : 'a]' > /dev/null; echo Retval = $?
expr 'a]b' : 'a[]]b' > /dev/null; echo Retval = $?
expr 'aed' : 'a[^bc]d' > /dev/null; echo Retval = $?
expr 'abd' : 'a[^bc]d' > /dev/null; echo Retval = $?
expr 'adc' : 'a[^-b]c' > /dev/null; echo Retval = $?
expr 'a-c' : 'a[^-b]c' > /dev/null; echo Retval = $?
expr 'a]c' : 'a[^]b]c' > /dev/null; echo Retval = $?
expr 'adc' : 'a[^]b]c' > /dev/null; echo Retval = $?
expr 'abc' : 'ab\|cd' > /dev/null; echo Retval = $?
expr 'abcd' : 'ab\|cd' > /dev/null; echo Retval = $?
expr 'def' : '()ef' > /dev/null; echo Retval = $?
expr '-' : '()*' > /dev/null; echo Retval = $?
expr '-' : '*a' > /dev/null; echo Retval = $?
expr '-' : '^*' > /dev/null; echo Retval = $?
expr '-' : '$*' > /dev/null; echo Retval = $?
expr '-' : '(*)b' > /dev/null; echo Retval = $?
expr 'b' : '$b' > /dev/null; echo Retval = $?
expr '-' : 'a\' > /dev/null; echo Retval = $?
expr 'a(b' : 'a\(b' > /dev/null; echo Retval = $?
expr 'ab' : 'a\(*b' > /dev/null; echo Retval = $?
expr 'a((b' : 'a\(*b' > /dev/null; echo Retval = $?
expr 'a\x' : 'a\x' > /dev/null; echo Retval = $?
expr '-' : 'abc)' > /dev/null; echo Retval = $?
expr '-' : '(abc' > /dev/null; echo Retval = $?
expr 'abc' : '((a))' > /dev/null; echo Retval = $?
expr 'abc' : '(a)b(c)' > /dev/null; echo Retval = $?
expr 'aabbabc' : 'a+b+c' > /dev/null; echo Retval = $?
expr '-' : 'a**' > /dev/null; echo Retval = $?
expr '-' : 'a*?' > /dev/null; echo Retval = $?
expr '-' : '(a*)*' > /dev/null; echo Retval = $?
expr '-' : '(a*)+' > /dev/null; echo Retval = $?
expr '-' : '(a\|)*' > /dev/null; echo Retval = $?
expr '-' : '(a*\|b)*' > /dev/null; echo Retval = $?
expr 'ab' : '(a+\|b)*' > /dev/null; echo Retval = $?
expr 'ab' : '(a+\|b)+' > /dev/null; echo Retval = $?
expr 'ab' : '(a+\|b)?' > /dev/null; echo Retval = $?
expr 'cde' : '[^ab]*' > /dev/null; echo Retval = $?
expr '-' : '(^)*' > /dev/null; echo Retval = $?
expr '-' : '(ab\|)*' > /dev/null; echo Retval = $?
expr '-' : ')(' > /dev/null; echo Retval = $?
expr '"' : 'a' > /dev/null; echo Retval = $?
expr '"' : 'a' > /dev/null; echo Retval = $?
expr '"' : 'a' > /dev/null; echo Retval = $?
expr 'abbbcd' : '([abc])*d' > /dev/null; echo Retval = $?
expr 'abcd' : '([abc])*bcd' > /dev/null; echo Retval = $?
expr 'e' : 'a\|b\|c\|d\|e' > /dev/null; echo Retval = $?
expr 'ef' : '(a\|b\|c\|d\|e)f' > /dev/null; echo Retval = $?
expr '-' : '((a*\|b))*' > /dev/null; echo Retval = $?
expr 'abcdefg' : 'abcd*efg' > /dev/null; echo Retval = $?
expr 'xabyabbbz' : 'ab*' > /dev/null; echo Retval = $?
expr 'xayabbbz' : 'ab*' > /dev/null; echo Retval = $?
expr 'abcde' : '(ab\|cd)e' > /dev/null; echo Retval = $?
expr 'hij' : '[abhgefdc]ij' > /dev/null; echo Retval = $?
expr 'abcde' : '^(ab\|cd)e' > /dev/null; echo Retval = $?
expr 'abcdef' : '(abc\|)ef' > /dev/null; echo Retval = $?
expr 'abcd' : '(a\|b)c*d' > /dev/null; echo Retval = $?
expr 'abc' : '(ab\|ab*)bc' > /dev/null; echo Retval = $?
expr 'abc' : 'a([bc]*)c*' > /dev/null; echo Retval = $?
expr 'abcd' : 'a([bc]*)(c*d)' > /dev/null; echo Retval = $?
expr 'abcd' : 'a([bc]+)(c*d)' > /dev/null; echo Retval = $?
expr 'abcd' : 'a([bc]*)(c+d)' > /dev/null; echo Retval = $?
expr 'adcdcde' : 'a[bcd]*dcdcde' > /dev/null; echo Retval = $?
expr 'adcdcde' : 'a[bcd]+dcdcde' > /dev/null; echo Retval = $?
expr 'abc' : '(ab\|a)b*c' > /dev/null; echo Retval = $?
expr 'abcd' : '((a)(b)c)(d)' > /dev/null; echo Retval = $?
expr 'alpha' : '[A-Za-z_][A-Za-z0-9_]*' > /dev/null; echo Retval = $?
expr 'abh' : '^a(bc+\|b[eh])g\|.h$' > /dev/null; echo Retval = $?
expr 'effgz' : '(bc+d$\|ef*g.\|h?i(j\|k))' > /dev/null; echo Retval = $?
expr 'ij' : '(bc+d$\|ef*g.\|h?i(j\|k))' > /dev/null; echo Retval = $?
expr 'effg' : '(bc+d$\|ef*g.\|h?i(j\|k))' > /dev/null; echo Retval = $?
expr 'bcdd' : '(bc+d$\|ef*g.\|h?i(j\|k))' > /dev/null; echo Retval = $?
expr 'reffgz' : '(bc+d$\|ef*g.\|h?i(j\|k))' > /dev/null; echo Retval = $?
expr '-' : '((((((((((a))))))))))' > /dev/null; echo Retval = $?
expr 'a' : '(((((((((a)))))))))' > /dev/null; echo Retval = $?
expr 'uh-uh' : 'multiple words of text' > /dev/null; echo Retval = $?
expr 'multiple words, yeah' : 'multiple words' > /dev/null; echo Retval = $?
expr 'abcde' : '(.*)c(.*)' > /dev/null; echo Retval = $?
expr '(.*)\)' : '\((.*),' > /dev/null; echo Retval = $?
expr 'ab' : '[k]' > /dev/null; echo Retval = $?
expr 'abcd' : 'abcd' > /dev/null; echo Retval = $?
expr 'abcd' : 'a(bc)d' > /dev/null; echo Retval = $?
expr 'ac' : 'a[-]?c' > /dev/null; echo Retval = $?
expr 'beriberi' : '(....).*\1' > /dev/null; echo Retval = $?
expr 'Muammar Qaddafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Mo'\''ammar Gadhafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Muammar Kaddafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Muammar Qadhafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Moammar El Kadhafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Muammar Gadafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Mu'\''ammar al-Qadafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Moamer El Kazzafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Moamar al-Gaddafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Mu'\''ammar Al Qathafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Muammar Al Qathafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Mo'\''ammar el-Gadhafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Moamar El Kadhafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Muammar al-Qadhafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Mu'\''ammar al-Qadhdhafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Mu'\''ammar Qadafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Moamar Gaddafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Mu'\''ammar Qadhdhafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Muammar Khaddafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Muammar al-Khaddafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Mu'\''amar al-Kadafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Muammar Ghaddafy' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Muammar Ghadafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Muammar Ghaddafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Muamar Kaddafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Muammar Quathafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Muammar Gheddafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Muamar Al-Kaddafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Moammar Khadafy ' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Moammar Qudhafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Mu'\''ammar al-Qaddafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
expr 'Mulazim Awwal Mu'\''ammar Muhammad Abu Minyar al-Qadhafi' : 'M[ou]'\''?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]' > /dev/null; echo Retval = $?
